package api

import (
	"github.com/fantomo/go-iching/app/api/model"
	"github.com/fantomo/go-iching/models/vo"
	"github.com/fantomo/go-iching/utils/http"
)

type DivinationService struct {
	M      *model.Divination
	Symbol string
}

func (serv DivinationService) Get() vo.Result {
	company, _ := model.GetDivinationDetailBySymbol(serv.Symbol)
	ok := true
	if company.ID < 1 {
		ok = false
	}
	return vo.Result{Code: http.SUCCESS, Msg: "success", Content: company, Ok: ok}
}


func (serv DivinationService) GetAll() vo.Result {
	company, _ := model.GetAll()
	return vo.Result{Code: http.SUCCESS, Msg: "success", Content: company, Ok: true}
}
